<div class="bg-light lter b-b wrapper-md">
  <h1 class="m-n font-thin h3">游团列表</h1>
</div>
<div class="panel panel-default">
  <div class="panel-body">
    <div class="col-lg-3">
      <div class="input-group">
        <div class="input-group-btn">
          <span class="btn btn-default">类型</span>
        </div>
        <ui-select ng-model="searchform.type" theme="bootstrap">
          <ui-select-match placeholder="请选择游团类型..">{{$select.selected.label}}</ui-select-match>
          <ui-select-choices repeat="item.value as item in searchform.groupTypeList">
            <span ng-bind-html="item.label"></span>
          </ui-select-choices>
        </ui-select>
      </div>
    </div>
    <div class="col-lg-2">
      <ui-select ng-model="searchform.model" theme="bootstrap">
        <ui-select-match placeholder="选择查询类型..">{{$select.selected.label}}</ui-select-match>
        <ui-select-choices repeat="item.value as item in searchform.model_type">
          <span ng-bind-html="item.label"></span>
        </ui-select-choices>
      </ui-select>
    </div>
    <div class="col-lg-2-4" ng-click="dateOpen($event, start_time)" ng-show="searchform.model == '2'">
      <div class="pull-left input-group">
        <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="start_time.lable"
          is-open="start_time.opened" readonly close-text="关闭" current-text="今天" clear-text="清除"
          ng-required="true"/>
        <span class="input-group-btn">
          <button type="button" class="btn btn-default">
            <i class="glyphicon glyphicon-calendar"></i>
          </button>
        </span>
      </div>
    </div>
    <div class="col-lg-2-4" ng-click="dateOpen($event, end_time)" ng-show="searchform.model == '2'">
      <div class="pull-left input-group">
        <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="end_time.lable"
          is-open="end_time.opened" readonly close-text="关闭" current-text="今天" clear-text="清除"
          ng-required="true"/>
        <span class="input-group-btn">
          <button type="button" class="btn btn-default">
            <i class="glyphicon glyphicon-calendar"></i>
          </button>
        </span>
      </div>
    </div>
    <div class="col-lg-2 pull-right">
      <button class="btn btn-success btn-block" ng-click="search(1, true)">立即搜索</button>
    </div>
  </div>

  <div class="panel-body">
    <!-- 网络太差, 画圈等 -->
    <h3 class="col-sm-12 text-center" ng-show="searchform.loading">
      <span ng-show="groupList.length == 0"><i class="fa fa-coffee"/> 无旅游团信息</span>
      <i class="fa fa-spin fa-spinner hide show inline" ng-show="groupList.length != 0"></i>
    </h3>

    <div class="panel panel-info" ng-show="!searchform.loading" ng-repeat="group in groupList">
      <div class="panel-heading" style="font-size: 16px">
        <span>创建企业：{{group.company_name}}</span>
        <span style="margin-left: 50px;">团编号：{{group.code}}</span>
        <span style="margin-left: 50px;">团类型：{{group.group_num > 2 ? '两日及多日游' : '一日游'}}</span>
        <span style="margin-left: 50px;">出行日期：{{group.travel_time}}</span>
        <span style="margin-left: 50px;">奖励人数：{{group.domestic_num + group.foreigner_num}}</span>
        <span class="pull-right"><button type="button" class="btn btn-info btn-xs" ng-click="personInfo(group)">游客名单</button></span>
      </div>
      <table class="table table-bordered">
        <thead>
          <tr>
            <th class="col-md-2 text-center">团票名称</th>
            <th class="col-md-1 text-center">出游时间</th>
            <th class="col-md-1 text-center">导游</th>
            <th class="col-md-1 text-center">导游电话</th>
            <th class="col-md-1 text-center">车牌号</th>
            <th class="col-md-1 text-center">实际人数</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat="info in group.detail">
            <td>{{info.name}}</td>
            <td class="text-center">{{info.travel_time}}</td>
            <td class="text-center">{{info.guide_name}}</td>
            <td class="text-center">{{info.guide_mobile}}</td>
            <td class="text-center">{{info.car_no}}</td>
            <td class="text-center">{{info.actual_num}}</td>
          </tr>
        </tbody>
      </table>
    </div>

  </div>
  <div class="text-right" ng-show="!searchform.loading" style="background-color: white; margin-right: 30px">
    <pagination total-items="totalItems" ng-model="currentPage" ng-change="search(currentPage, false)" 
     previous-text="上一页" next-text="下一页" first-text="首页" last-text="尾页" max-size="5" 
     boundary-links="true" rotate="false" items-per-page="itemsPerPage" class="m-t-none m-b"></pagination>
  </div>

</div>
